#! usr/bin/python3
# coding=utf-8
# @Time: 2025/9/9 
# @Author: GaoSheng

from selenium.webdriver.common.by import By

from base.ObjectMap import ObjectMap
from base.ProductListBase import ProductListBase


class ProductListPage(ProductListBase, ObjectMap):
    def click_search_button(self, driver, button_name):
        """
        点击查询按钮
        :param driver:
        :param tab_name:
        :return:
        """
        button_xpath = self.search_button(button_name)
        return self.element_click(driver, By.XPATH, button_xpath)

    def get_search_successful_p(self, driver):
        """
        获取查询成功提示
        :param driver:
        :return:
        """
        p_xpath = self.search_successful_p()
        return self.element_get(driver, By.XPATH, p_xpath, must_be_visible=True)
